<div style="padding:10px 20px 20px 20px;margin:0px 0;">
	<div style="float:left;margin:10px 0px 10px 0;width:100%;">
	<form th:id="${formID}" action="#"  method="post" enctype="multipart/form-data">
		<div style="margin:0 20px;float:left;">
		<input  id="typeName" class="easyui-textbox wd50" type="text" 
					th:label="#{typeInfo.typeName}+'  :'" label="类别名称"  name="typeName"   />
			<br style="clear:both;">
		</div>
		<div style="margin:0 20px;float:left;">
		<input  id="typeGroup" class="easyui-textbox wd50" type="text" 
					th:label="#{typeInfo.typeGroup}+'  :'" label="类别分组编号"  name="typeGroup"   />
			<br style="clear:both;">
		</div>
		<div style="margin:0 20px;float:left;">
		<input  id="typeLevel" class="easyui-textbox wd50" type="text" 
					th:label="#{typeInfo.typeLevel}+'  :'" label="级别"  name="typeLevel"   />
			<br style="clear:both;">
		</div>
		<div style="margin:0 20px;float:left;">
		<input  id="typeSort" class="easyui-textbox wd50" type="text" 
					th:label="#{typeInfo.typeSort}+'  :'" label="排序"  name="typeSort"   />
			<br style="clear:both;">
		</div>
		<div style="margin:0 20px;float:left;">
		<input  id="typeStatus" class="easyui-textbox wd50" type="text" 
					th:label="#{typeInfo.typeStatus}+'  :'" label="状态"  name="typeStatus"   />
			<br style="clear:both;">
		</div>
		<div style="margin:0 20px;float:left;">
		<input  id="typeDesc" class="easyui-textbox wd50" type="text" 
					th:label="#{typeInfo.typeDesc}+'  :'" label="描述"  name="typeDesc"   />
			<br style="clear:both;">
		</div>
		<div style="margin:0 20px;float:left;clear:right;">
			<a th:href="'javascript:search(\''+${formID}+'\')'" class="easyui-linkbutton" iconCls="icon-search">查询</a>
		</div>
	</form>
	</div>
	<div style="float:left;margin-bottom:1px;width:100%;">
	<div style="float:left;">
		<a th:href="'javascript:batchdel(\''+${formID}+'\')'" class="easyui-linkbutton">批量删除</a>
		<input th:id="'show'+${formID}" type="hidden" th:value="@{type/typeInfo/queryForTypeInfoDetail}" />
		<input th:id="'edit'+${formID}" type="hidden" th:value="@{type/typeInfo/addTypeInfo}" /> 
		<input th:id="'del'+${formID}" type="hidden" th:value="@{type/typeInfo/deleteByTypeInfoId}" />
		<input th:id="'mid'+${formID}" type="hidden" value="typeCode" />
		<input th:id="'batchdel'+${formID}" type="hidden" th:value="@{type/typeInfo/deleteByTypeInfoIdBatch}" /> 
	</div>
	<div style="margin-left:10px;float:right;">
		<a th:id="'imp'+${formID}"  href="#" class="easyui-linkbutton" iconCls="" th:onclick="'javascript:importExcelMode(\''+${formID}+'\')'">导入</a>&nbsp;
		<a href="#" class="easyui-linkbutton" iconCls="" th:onclick="'javascript:downloadExcelMode(\''+@{/UploadFiles/Fj/AqglHseAqjc.xlsx}+'\')'">下载模板</a> &nbsp;
		<a href="#" class="easyui-linkbutton" iconCls="" onclick="exportExcelMode(\''+${formID}+'\')'">导出</a>
		
	</div>
	<form th:id="'impForm'+${formID}" action="#"  method="post" enctype="multipart/form-data"> 
		<div style="margin-left:10px;float:right;">
			<input class="easyui-filebox"
			data-options="label:'导入文件:',prompt:'请选择一个Excel文件',buttonText:'选择文件',
			accept:'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel'"
			th:id="'file'+${formID}"  name="file" style="width:300px;">
		</div>
	</form>
	</div>

	<table  th:id="'datagrid'+${formID}" class="easyui-datagrid" title="类别常量表" style="width:100%;"
			data-options="url:'type/typeInfo/queryForTypeInfoListDG',
			method:'get',rownumbers:true, nowrap: false,singleSelect:false,autoRowHeight: true,
			fitColumns: true,striped:true,idField:'menuInfoId',loadMsg: '正在加载...',pagination:true,pageSize:10">
		<thead data-options="frozen:true">
			<tr>
				<th data-options="field:'ck',checkbox:true" ></th>
				<th data-options="field:'typeName',resizable:true,halign:'center'" width="15%"><span th:text="#{typeInfo.typeName}">类别名称</span></th>
				<th data-options="field:'typeGroup',resizable:true,halign:'center'" width="15%"><span th:text="#{typeInfo.typeGroup}">类别分组编号</span></th>
				<th data-options="field:'typeLevel',resizable:true,halign:'center'" width="15%"><span th:text="#{typeInfo.typeLevel}">级别</span></th>
				<th data-options="field:'typeSort',resizable:true,halign:'center'" width="15%"><span th:text="#{typeInfo.typeSort}">排序</span></th>
				<th data-options="field:'typeStatus',resizable:true,halign:'center'" width="15%"><span th:text="#{typeInfo.typeStatus}">状态</span></th>
				<th data-options="field:'typeDesc',resizable:true,halign:'center'" width="15%"><span th:text="#{typeInfo.typeDesc}">描述</span></th>
				<th data-options="field:'typeCode',align:'center',formatter:onOptTypeInfo" width="10%">操作</th> 
			</tr>
		</thead>
	</table> 
</div> 
<script type="text/javascript">
	//操作
	function onOptTypeInfo(value,row,index){ 
		var s =  '<a class="Edit_Button" href="javascript:showDetail(\''+value+'\',\'展示《'+row.typeName+'》详情信息\',\'[[${formID}]] \')">详细</a>'+
			'&nbsp;'+
			'<a class="Edit_Button" href="javascript:edit(\''+value+'\',\'编辑《'+row.typeName+'》信息\',\'[[${formID}]] \')">编辑</a>'+
			'&nbsp;'+
			'<a class="Delete_Button" href="javascript:remove(\''+value+'\',\'[[${formID}]]\')" >删除</a>' ;
		return s;
	}
	
	//导入 
	function importExcelMode(formID){
		var file = $('#file'+formID).filebox('getValue');
		if(file==""){ 
			 $.messager.alert({ width: 350, title:'温馨提示', msg:'导入文件不能为空!', icon:'info'});
			return; 
		}
		 $('#imp'+formID).linkbutton('disable');
		$("#impForm"+formID).ajaxSubmit({
			type: "post",
			dataType: "json",
			url: '[[@{type/typeInfo/importGenerateInfo }]]', 
			success:function(data){ 
				$('#imp'+formID).linkbutton('enable'); 
				console.log(data)
				if (data.code == 200) {
					dataReload(formID); 
					$.messager.alert({width: 280,title: '操作成功',msg: data.msg, icon:'info'});
				}else{
					$.messager.alert({ width: 280, title:'数据提交异常', msg:data.msg});
				}
			},error: function (data) {
				$('#imp'+formID).linkbutton('enable'); 
				$.messager.alert('消息提醒','上传失败，数据异常！');
			}
		});
	}
			
			
		
	

</script>



